﻿using System;
using System.Collections.Generic;
using System.Web;
using DataAccess;
using System.Data;
/// <summary>
/// Summary description for SchoolSubjectsBS
/// </summary>
public class SchoolSubjectsBS 
{
    SchoolSubjectsDAO SS;
    public SchoolSubjectsBS()
    {
        SS = new SchoolSubjectsDAO();
        //
        // TODO: Add constructor logic here
        //
    }
    public List<SchoolSubjects> ShowSubjects()
    {
        DataTable tbl = SS.ShowSubjects();
        List<SchoolSubjects> list = new List<SchoolSubjects>();
        foreach (DataRow row in tbl.Rows)
        {
            SchoolSubjects SY = new SchoolSubjects(int.Parse(row[0].ToString()), row[1].ToString(), int.Parse(row[2].ToString()), row[3].ToString());
            list.Add(SY);
        }
        return list;
    }
    public int CodeSubjects(string NameSubjects)
    {
        int code = SS.CodeSubjects(NameSubjects);
        return code;
    }
}